﻿using System.Threading.Tasks;
using Volo.Abp.Threading;

namespace Xms.Abp.Caching;

public interface ICacheProvider
{
    string Name { get; }

    Task<IXmsCache> GetCacheAsync();

    public IXmsCache GetCache()
    {
        return AsyncHelper.RunSync(async () => await GetCacheAsync());
    }
}

public interface ICacheProvider<TCacheContext> : ICacheProvider
    where TCacheContext : CacheContext<TCacheContext>
{

}
